from django.db import models

from social.account.models import User
from social.utils.models import BaseModel


class Report(BaseModel):
    user = models.ForeignKey(User, related_name='reports', on_delete=models.CASCADE)
    content = models.TextField()
    type = models.CharField(max_length=20)
    extra = models.TextField(null=True)

    class Meta:
        index_together = [
            ('user', 'created_at')
        ]


class UpdateVersion(BaseModel):
    url = models.TextField()
    version_name = models.CharField(max_length=20)
    build = models.IntegerField(default=1)
    desc = models.TextField()
    force_update = models.BooleanField(default=False)
    size = models.IntegerField(default=0)
